Skip to content
This repository was archived by the owner on Mar 13, 2022. It is now read-only.

Add jsDoc annotations to quasar.conf parameters#138

Open
panstromek wants to merge 1 commit intoquasarframework:masterfrom
panstromek:patch-1
Open

Add jsDoc annotations to quasar.conf parameters#138
panstromek wants to merge 1 commit intoquasarframework:masterfrom
panstromek:patch-1

Conversation

@panstromek
Copy link
Copy Markdown

This will enable code inspections and autocomplete in editors that can pick it up for users that don't use typescript.

cc @IlCallo to make sure this doesn't break typescript in some unexpected way. I don't use typescript in Quasar, so I can't tell.

This will enable code inspections and autocomplete in editors that can pick it up for users that don't use typescript.
@IlCallo
Copy link
Copy Markdown
Member

IlCallo commented Jan 30, 2021

AFAIK the configure wrapper should already provide autocomplete powered by TypeScript also to JS projects.
You're right to the fact that currently JS users won't get it out of the box, but we can enable it.
Can you check if using configure wrapper actually enable autocomplete in your JS projects?

@panstromek
Copy link
Copy Markdown
Author

I can, but I'll need to update some projects to v2.0 version to check that. I came back to maintain some things after long time, so my setup is kinda outdated.

@IlCallo
Copy link
Copy Markdown
Member

IlCallo commented Jan 30, 2021

You mean @quasar/app v2? If I remember correctly, those wrappers are there since v1.x 🤔

@IlCallo
Copy link
Copy Markdown
Member

IlCallo commented Jan 30, 2021

You can see this by looking at q/app v1 branch here, where they are already used:

module.exports = {{#preset.typescript}}configure({{/preset.typescript}}function ({{#preset.lint}}{{#preset.typescript}}ctx{{else}}/* ctx */{{/preset.typescript}}{{else}}/* ctx */{{/preset.lint}}) {

@panstromek
Copy link
Copy Markdown
Author

Oh, right. I tried it now, it doesn't work with them - idea doesn't pick up their typings, so they are just treated as just blank functions. Only the doc comment seems to work in this case.

@IlCallo
Copy link
Copy Markdown
Member

IlCallo commented Feb 8, 2021

I'm searching stuff on this topic. Adding JSDocs on quasar.conf file isn't a good idea as we also have these kind of TS-powered typings on boot files etc. It's a thing which must be fixed in the monorepo.
Best idea would be to add those JSDocs into ui/wrappers/index.js implementation, but I could not find an explanation anywhere about how does IDEA crawl for types.

Eg, would this work without any import from @quasar/app when actually used?

/**
 * @param {ConfigureCallback} callback
 * @return {ConfigureCallback}
 */
module.exports.configure = function (callback) {
  return callback
}

Can you try it out in some way?

@IlCallo
Copy link
Copy Markdown
Member

IlCallo commented Feb 26, 2021

@panstromek any news?

@panstromek
Copy link
Copy Markdown
Author

Sorry, I haven't had time to look at this more.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants